//
//  Top_upPriceCell.m
//  WanCaiC8
//
//  Created by tangang on 2018/4/19.
//  Copyright © 2018年 tangang. All rights reserved.
//

#import "Top_upPriceCell.h"

@implementation Top_upPriceCell{
    QXLable     *lab;
    UIImageView *imageV;
}

- (instancetype)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
        lab=[[QXLable alloc]initTitle];
        lab.textColor=NAVCOLOR;
        lab.layer.masksToBounds=YES;
        lab.layer.cornerRadius=2.0;
        lab.textAlignment=NSTextAlignmentCenter;
        lab.layer.borderWidth=.7;
        [self.contentView addSubview:lab];
        [lab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.contentView);
        }];
        
        imageV=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"top_upSelect"]];
        [self.contentView addSubview:imageV];
        [imageV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.bottom.equalTo(lab);
            make.size.mas_equalTo(imageV.image.size);
        }];
    }
    return self;
}

- (void)setTitle:(NSString *)title andIsSelect:(BOOL)isSelect{
    lab.text=title;
    if (isSelect) {
        lab.layer.borderColor=NAVCOLOR.CGColor;
        lab.textColor=NAVCOLOR;
    }else{
        lab.layer.borderColor=DEFAULTTEXTGRAYCOLOR.CGColor;
        lab.textColor=DEFAULTTEXTGRAYCOLOR;
    }
    imageV.hidden=!isSelect;
}

@end
